require('./PageShownoticemember.styl');
import { Control } from 'react-keeper';
import {  NavBar,Context } from 'saltui';
const reactMixin = require('react-mixin');
const Actions = require('./actions');
const Store = require('./store');
const RollUp = require('components/rollup');
const classNames = require("classnames")
class Shownoticemember extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            listData: []
        };
        this.handleOnLeftClick = this.handleOnLeftClick.bind(this)
    }
    handleOnLeftClick() {
        Control.go(-1);
    }
    render() {
        return (
            <div className="shownoticemember">
                <NavBar
                    className={classNames({"ios-nav-bar":window.isIphone})}
                    isShow={false}
                    onLeftClick={this.handleOnLeftClick}
                    onRightClick={Context.noop}
                    rightText={''}
                    title="查看发布对象"
                />
                {this.state.listData.length > 0 ? this.state.listData.map((item, index) => {
                    return (
                        <RollUp
                            data={item}
                            ref={`roll${index}`}
                            key={`roll${index}`}
                            nocheckround
                        />);
                }) : <div className="t-FAC t-SMT100">暂无节点数据</div>}
            </div>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
        Actions.fetch(Control.state.data);
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

reactMixin.onClass(Shownoticemember, Reflux.connect(Store));

module.exports = Shownoticemember;
